home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
util
/
sys
/
Alloc32P.readme
< prev
next >
Wrap
Text File
|
1997-11-02
|
4KB
|
111 lines
Short: Alloc32P - AllocMem/AllocVec patch V2.0
Author: Andreas_Kleinert@t-online.de
Uploader: Andreas_Kleinert@t-online.de
Type: util/sys
This patch does a few things:
o Sometimes programs fail with a "not enough memory" error,
but after calling "avail flush" the same operation does
succeed without problems.
Obviously AllocMem/AllocVec does not force such a "flush"
operation AND tries to allocate memory again, immediately
after the flushing has been done. Why ? Why has the program
to assume, that its allocation did fail, although there may
has been some memory released by the flush ?
This patch does ensure, that AllocMem/AllocVec won't
fail unless there's really no memory available, even
by flushing. This means:
- less "out of memory" failures
- less "bad behaviour" of bad programs, which don't
check results of AllocMem/AllocVec
- no more need to call "avail flush" by hand
from the shell
- thus no more "retry" operations after "avail flush"
- no more unused libraries/devices consuming memory
when it is already low
o (new) AllocMem() and AllocVec() calls are changed into
new-style memory allocation calls
o 32 Byte alignment for new-style memory allocated buffers
o new-style memory allocation does work as follows: each
memory request will be extended by space for certain
administration data, which fulfils several tasks:
- it does contain some information on the allocation,
such as buffer size and various pointers
- imitating an AllocVec allocation
- aligning the actually used buffer pointer to the
next 32 byte boundary (Exec aligns to 8 byte
boundaries, so we add another 24 bytes)
Additionally, this alignment also takes place at the
end of the buffer, where upto 31 bytes may be added,
to align it to the next 32 byte boundary.
So, each memory allocation will at least be 64 bytes
wide.
o delocating a new style buffer works by taking the
information from the extended space (from within
the extra 24 bytes), which does work quite similar
to a common AlloVec call, where the buffer size is
stored before the buffer, too. But with Alloc32P,
this is possible with usual AllocMem() calls as well.
The "size" parameter of a FreeMem(ptr, size) call
will be ignored - or optionally just be used for safety
comparisons.
o basically it does not matter, at which point you start
the patch, since it will recognize, when any program does
try to delocate buffers that had been allocated before the
patch had been running. It then will delocate these
the old way. But it does make sense, to TEST it fromout
the Shell first, and THEN add it to s:startup-sequence
or s:user-startup
Note: Needs V37+ and 68020.
Note: DO NOT RUN MUNGWALL IN PARALLEL - IT WILL NOT
RECOGNIZE THE PATCH AND MAY PRODUCE ENDLESS
MUNGWALL HITS !
(Additionally, this does not make sense anyway,
since the patch may falsify the results out
of testing buggy programs - it may compensate
some of these bugs actually ;)
Usage: Try starting in the Shell/CLI.
If it does run stable, copy it into
your C: directory and add it
somewhere into your s:user-startup
AllocP >NIL: <NIL:
You use this patch at YOUR OWN RISK.
No guarantee for anything.
Source code included.
---
All mentioned trademarks are subject to their owners.
============================= Archive contents =============================
Original Packed Ratio Date Time Name
-------- ------- ----- --------- -------- -------------
3534 1638 53.6% 02-Oct-97 21:03:44 +Alloc32P.readme
3992 2369 40.6% 02-Oct-97 21:00:32 +AllocP
11174 2266 79.7% 02-Oct-97 21:00:18 +AllocP.c
835 390 53.2% 01-Aug-97 10:07:56 +AllocP.info
1776 987 44.4% 02-Oct-97 21:00:30 +AllocP.o
141 115 18.4% 16-Aug-97 09:12:24 +SCOPTIONS
163 101 38.0% 02-Oct-97 18:24:36 +smakefile
-------- ------- ----- --------- --------
21615 7866 63.6% 11-Oct-97 00:04:04 7 files